package edu.java.texbooks.scjp.threads.test02;

public class Thread01 extends Thread {

	// --- Instance variables --------------------------------------------------
	private static final int RANGE1 = 3;
	private static final int RANGE2 = 100000;

	// --- Constructors --------------------------------------------------------
	public Thread01() {

	}

	public Thread01(int priority) {
		setPriority(priority);
	}

	// --- Methods -------------------------------------------------------------
	@Override
	public void run() {
		System.out.println("Execute thread 1.");
		for (int i = 0; i < RANGE1; i++) {
			for (int j = 0; j < RANGE2; j++) {

			}
			System.out.println("Call yield() method in thread 1.");
			Thread.yield();
			System.out
					.println("Start thread 1 after calling of yield() method.");
		}
		System.out.println("Finish thread 1.");
	}
}
